import React from 'react';
import ReactDOM from 'react-dom/client';

import Sample from './sample';
import Error from './error';

window.reactRender = (element, component, props) => {
    const root = ReactDOM.createRoot(element);
    let ReactComponent;
    switch (component) {
        case 'Sample':
            ReactComponent = Sample;
            break;
        default:
            ReactComponent = Error;
            break;
    }
    root.render(<ReactComponent component={component} {...props} />);
}
